<template>
	<view>
		<view v-show="isMobile" >
			<view v-if="windowWidth<=768">
				<image style="width: 100%;height: 120rpx;" src="../static/images/rectangle.png"></image>
			</view>

			<view class="index-container">
				<view class="index-content">
          <uni-section title="我的下达" titleFontSize="30rpx" type="line">
					<uni-row>
						<uni-col :span="8">
							<view class="index-article">
								<el-link @click="toIssuanceThroughList(7,1)" class="index-article-text" style="color: #28A3FF;">{{cggzCount}}<text
										style="font-size: 30rpx;">个</text></el-link>
								<text>常规工作</text>
							</view>

						</uni-col>
						<uni-col :span="8">
							<view class="index-article">
								<el-link  @click ="toIssuanceThroughList(7,2)" class="index-article-text" style="color: #7E2AF5;">{{yjygCount}}<text
										style="font-size: 30rpx;">个</text></el-link>
								<text>预警预告</text>
							</view>
						</uni-col>
						<uni-col :span="8">
							<view class="index-article">
								<el-link @click="toIssuanceThroughList(7,3)" class="index-article-text" style="color: #FB293B;">{{tfsjCount}}<text
										style="font-size: 30rpx;">个</text></el-link>
								<text>突发事件</text>
							</view>
						</uni-col>
					</uni-row>
          </uni-section>
				</view>


				<view class="index-content">
					<uni-row>
						<uni-col :span="24">
							<view style="width: 100%;background-color: #409EFF;border-radius: 10px;padding: 30rpx;position: relative;color: #fff;text-align: center;"  @click="selectXdlx">
								<p >下达</p>
								<image class="index-nav-image" src="../static/images/xd2.png" mode="aspectFill" ></image>

							</view>
						</uni-col>
					</uni-row>
					<uni-row style="margin-top: 10px;">
						<uni-col :span="24">
<view style="width: 100%;background-color: #409EFF;border-radius: 10px;padding: 30rpx;position: relative;color: #fff;text-align: center;"  @click="toIssuanceThroughList(3)">
						<p >反馈</p>
						<image class="index-nav-image" src="../static/images/fk2.png" mode="aspectFill" ></image>

					</view>
						</uni-col>
					</uni-row>
					<!--        <uni-row>-->
					<!--          <uni-col :span="24">-->
					<!--            <view class="index-nav" @click="toIssuanceThroughList(2)">-->
					<!--              <image src="../static/images/top1.png" mode="aspectFill"></image>-->
					<!--              <text>逐级下达</text>-->
					<!--            </view>-->
					<!--          </uni-col>-->
					<!--        </uni-row>-->
					<!--        <uni-row>-->
					<!--          <uni-col :span="24">-->
					<!--            <view class="index-nav" @click="toIssuanceThroughList(4)">-->
					<!--              <image class="index-nav-image" src="../static/images/top4.png" mode="aspectFill"></image>-->
					<!--              <text>历史下达</text>-->
					<!--            </view>-->
					<!--          </uni-col>-->
					<!--        </uni-row>-->
				</view>


			<!-- 	<view class="index-content">
					<uni-section title="超期事项" titleFontSize="30rpx" type="line">
						<template v-slot:right>
							<text @click="toIssuanceThroughList(6)" style="font-size: 25rpx;color: grey;">详情 ></text>
						</template>
						<uni-row>
							<uni-col :span="8">
								<view class="index-article">
									<text>常规工作</text>
									<text class="index-article-text-mid" style="color: #28A3FF;">{{cggzCsCount}}<text
											style="font-size: 30rpx;">个</text></text>
								</view>

							</uni-col>
							<uni-col :span="8">
								<view class="index-article">
									<text>预警预告</text>
									<text class="index-article-text-mid" style="color: #7E2AF5;">{{yjygCsCount}}<text
											style="font-size: 30rpx;">个</text></text>
								</view>
							</uni-col>
							<uni-col :span="8">
								<view class="index-article">
									<text>突发事件</text>
									<text class="index-article-text-mid" style="color: #FB293B;">{{tfsjCsCount}}<text
											style="font-size: 30rpx;">个</text></text>
								</view>
							</uni-col>
						</uni-row>
					</uni-section>
				</view>
			 -->
			 <view class="index-content">
					<!--				<uni-section title="应急响应" titleFontSize="30rpx" type="line">-->
					<!--					<uni-row>-->
					<!--						<uni-col :span="12">-->
					<!--							<view style="background-color: #DEF1FF;" class="index-section">-->
					<!--								<image style="width: 15%;height: 40rpx;" src="../static/images/mid1.svg"-->
					<!--									mode="aspectFill"></image>-->
					<!--								<text style="margin-left: 10rpx;">已读响应</text>-->
					<!--								<text style="margin-left: 20rpx;color: #4B84EC;font-size: 40rpx;">15</text>-->
					<!--								<text>分</text>-->
					<!--								<text style="margin-left: 10rpx;color: grey;">></text>-->
					<!--							</view>-->
					<!--						</uni-col>-->
					<!--						<uni-col :span="12">-->
					<!--							<view style="background-color: #DAF2F0;" class="index-section">-->
					<!--								<image style="width: 15%;height: 40rpx;" src="../static/images/mid2.svg"-->
					<!--									mode="aspectFill"></image>-->
					<!--								<text style="margin-left: 10rpx;">反馈响应</text>-->
					<!--								<text style="margin-left: 20rpx;color: #1FADA1;font-size: 40rpx;">56</text>-->
					<!--								<text>分</text>-->
					<!--								<text style="margin-left: 10rpx;color: grey;">></text>-->
					<!--							</view>-->
					<!--						</uni-col>-->
					<!--					</uni-row>-->
					<!--				</uni-section>-->
					<uni-section title="最近事项" titleFontSize="30rpx" type="line">
						<template v-slot:right>
							<text @click="toIssuanceThroughList(5)" style="font-size: 25rpx;color: grey;">详情 ></text>
						</template>
						<view style="margin-left: 40rpx;text-decoration: underline;margin-bottom: 90rpx;">
							<text style="font-size: 30rpx;font-weight: 600;">{{recentlyRw.sxbt}}</text>
						</view>
						<view class="" style="min-height: 200rpx;">
							<uni-row>
								<uni-col :span="9">
									<view class="index-article-bottom">
										<image style="width: 160rpx;height: 160rpx;" src="../static/images/triangle.png"
											mode="aspectFill">
										</image>
										<text
											style="font-size: 35rpx;color: white;margin-top: -80rpx;position: sticky;">{{recentlyRw.xdsl}}</text>
										<!-- <text style="margin-top: 50rpx;">下达总数</text> -->
									</view>
								</uni-col>
								<uni-col :span="5">
									<view class="index-article-bottom">
										<image style="width: 30%;height: 50upx;margin-bottom: 10rpx;"
											src="../static/images/light1.svg" mode="aspectFill"></image>
										<text style="margin-bottom: 10rpx;">未读</text>
										<text style="font-size: 44rpx;color: #FF142A;">{{recentlyRw.wdsl}}</text>
									</view>
								</uni-col>
								<uni-col :span="5">
									<view class="index-article-bottom">
										<image style="width: 30%;height: 50rpx;;margin-bottom: 10rpx;"
											src="../static/images/light2.svg" mode="aspectFill"></image>
										<text style="margin-bottom: 10rpx;">未反馈</text>
										<text style="font-size: 44rpx;color: #FF8400;">{{recentlyRw.wfk}}</text>
									</view>
								</uni-col>
								<uni-col :span="5">
									<view class="index-article-bottom">
										<image style="width: 30%;height: 50rpx;;margin-bottom: 10rpx;"
											src="../static/images/light3.svg" mode="aspectFill"></image>
										<text style="margin-bottom: 10rpx;">已反馈</text>
										<text style="font-size: 44rpx;color: #1DEE42;">{{recentlyRw.yfk}}</text>
									</view>
								</uni-col>
							</uni-row>
						</view>
					</uni-section>
				</view>
        <view class="index-content">
          <uni-section title="超期事项" titleFontSize="30rpx" type="line">
            <view class="charts-box">
              <qiun-data-charts
                  type="ring"
                  :opts="opts"
                  :chartData="chartData"
              />
            </view>
          </uni-section>
        </view>
        <view class="index-content">
          <uni-section title="部门统计" titleFontSize="30rpx" type="line">
            <view class="charts-box">
              <qiun-data-charts
                  type="column"
                  :opts="opts1"
                  :chartData="chartData1"
              />
            </view>
          </uni-section>
        </view>
        <view class="index-content">
          <uni-section title="地区反馈统计" titleFontSize="30rpx" type="line">
            <view class="charts-box">
              <qiun-data-charts
                  type="bar"
                  :opts="opts2"
                  :chartData="chartData2"
              />
            </view>
          </uni-section>
        </view>
			</view>
			<view class="action-btn fixed-bottom">
				<button @click="exitApp" class="login-btn cu-btn block lg">返回上一级</button>
			</view>
		</view>
		<div class="app-container" v-show="!isMobile">

			<el-card shadow="hover" class="card">
        <uni-section title="我的下达" titleFontSize="30rpx" type="line">
				<uni-row>
					<uni-col :span="8">
						<view class="index-article">
							<el-link @click="toIssuanceThroughList(7,1)" class="index-article-text" style="color: #28A3FF;">{{cggzCount}}<text
                  style="font-size: 30rpx;">个</text></el-link>
							<text>常规工作</text>
						</view>

					</uni-col>
					<uni-col :span="8">
						<view class="index-article">
							<el-link @click="toIssuanceThroughList(7,2)" class="index-article-text" style="color: #7E2AF5;">{{yjygCount}}<text
									style="font-size: 30rpx;">个</text></el-link>
							<text>预警预告</text>
						</view>
					</uni-col>
					<uni-col :span="8">
						<view class="index-article">
							<el-link @click="toIssuanceThroughList(7,3)" class="index-article-text" style="color: #FB293B;">{{tfsjCount}}<text
									style="font-size: 30rpx;">个</text></el-link>
							<text>突发事件</text>
						</view>
					</uni-col>
				</uni-row>
        </uni-section>
			</el-card>


			<el-card shadow="hover" class="card">
				<uni-row :gutter="10">
<!--					<uni-col :span="windowWidth<=768?24:12">-->
					<uni-col :span="24" style="margin-bottom: 10px;">
						<view style="width: 100%;background-color: #409EFF;border-radius: 10px;padding: 30rpx;position: relative;color: #fff;text-align: center;"  @click="selectXdlx">
							<p >下达</p>
							<image class="index-nav-image" src="../static/images/xd2.png" mode="aspectFill" ></image>

						</view>
					</uni-col>
<!--					<uni-col :span="12" v-if="windowWidth>768">-->
					<uni-col :span="24">
					<view style="width: 100%;background-color: #409EFF;border-radius: 10px;padding: 30rpx;position: relative;color: #fff;text-align: center;"  @click="toIssuanceThroughList(3)">
						<p >反馈</p>
						<image class="index-nav-image" src="../static/images/fk2.png" mode="aspectFill" ></image>

					</view>
					</uni-col>
				</uni-row>
				<uni-row style="margin-top: 10px;" v-if="windowWidth<=768">
					<uni-col :span="24">
					<view style="width: 100%;background-color: #409EFF;border-radius: 10px;padding: 30rpx;position: relative;color: #fff;text-align: center;"  @click="toIssuanceThroughList(3)">
						<p >反馈</p>
						<image class="index-nav-image" src="../static/images/fk2.png" mode="aspectFill" ></image>

					</view>
					</uni-col>
				</uni-row>
				<!--        <uni-row>-->
				<!--          <uni-col :span="24">-->
				<!--            <view class="index-nav" @click="toIssuanceThroughList(2)">-->
				<!--              <image src="../static/images/top1.png" mode="aspectFill"></image>-->
				<!--              <text>逐级下达</text>-->
				<!--            </view>-->
				<!--          </uni-col>-->
				<!--        </uni-row>-->
				<!--        <uni-row>-->
				<!--          <uni-col :span="24">-->
				<!--            <view class="index-nav" @click="toIssuanceThroughList(4)">-->
				<!--              <image class="index-nav-image" src="../static/images/top4.png" mode="aspectFill"></image>-->
				<!--              <text>历史下达</text>-->
				<!--            </view>-->
				<!--          </uni-col>-->
				<!--        </uni-row>-->
			</el-card>
			<!-- <el-card shadow="hover" class="card">
				<uni-section title="超期事项" titleFontSize="30rpx" type="line">
					<template v-slot:right>
						<text @click="toIssuanceThroughList(6)" style="font-size: 25rpx;color: grey;">详情 ></text>
					</template>
					<uni-row>
						<uni-col :span="8">
							<view class="index-article">
								<text>常规工作</text>
								<text class="index-article-text-mid" style="color: #28A3FF;">{{cggzCsCount}}<text
										style="font-size: 30rpx;">个</text></text>
							</view>

						</uni-col>
						<uni-col :span="8">
							<view class="index-article">
								<text>预警预告</text>
								<text class="index-article-text-mid" style="color: #7E2AF5;">{{yjygCsCount}}<text
										style="font-size: 30rpx;">个</text></text>
							</view>
						</uni-col>
						<uni-col :span="8">
							<view class="index-article">
								<text>突发事件</text>
								<text class="index-article-text-mid" style="color: #FB293B;">{{tfsjCsCount}}<text
										style="font-size: 30rpx;">个</text></text>
							</view>
						</uni-col>
					</uni-row>
				</uni-section>
			</el-card>
			 -->
      <el-card shadow="hover" class="card">
				<uni-section title="最近事项" titleFontSize="30rpx" type="line">
					<template v-slot:right>
						<text @click="toIssuanceThroughList(5)" style="font-size: 25rpx;color: grey;">详情 ></text>
					</template>
					<view style="margin-left: 40rpx;text-decoration: underline;margin-bottom: 90rpx;">
						<text style="font-size: 30rpx;font-weight: 600;">{{recentlyRw.sxbt}}</text>
					</view>
					<view class="">
						<uni-row>
							<uni-col :span="9">
								<view class="index-article-bottom">
									<image style="width:280rpx;height: 280rpx;margin-bottom: 10rpx;"
										src="../static/images/triangle.png" mode="aspectFill">
									</image>
									<text
										style="font-size: 35rpx;color: white;margin-top: -150rpx;position: sticky;">{{recentlyRw.xdsl}}</text>
									<!-- <text style="margin-top: 50rpx;">下达总数</text> -->
								</view>
							</uni-col>
							<uni-col :span="5">
								<view class="index-article-bottom">
									<image class="iconSize" src="../static/images/light1.svg" mode="aspectFill"></image>
									<text style="margin-bottom: 10rpx;">未读</text>
									<text style="font-size: 44rpx;color: #FF142A;">{{recentlyRw.wdsl}}</text>
								</view>
							</uni-col>
							<uni-col :span="5">
								<view class="index-article-bottom">
									<image class="iconSize" src="../static/images/light2.svg" mode="aspectFill"></image>
									<text style="margin-bottom: 10rpx;">未反馈</text>
									<text style="font-size: 44rpx;color: #FF8400;">{{recentlyRw.wfk}}</text>
								</view>
							</uni-col>
							<uni-col :span="5">
								<view class="index-article-bottom">
									<image class="iconSize" src="../static/images/light3.svg" mode="aspectFill"></image>
									<text style="margin-bottom: 10rpx;">已反馈</text>
									<text style="font-size: 44rpx;color: #1DEE42;">{{recentlyRw.yfk}}</text>
								</view>
							</uni-col>
						</uni-row>
					</view>
				</uni-section>
			</el-card>
      <el-card shadow="never" class="card">
        <uni-section title="超期事项" titleFontSize="30rpx" type="line">
          <view class="charts-box">
            <qiun-data-charts
                type="ring"
                :opts="opts"
                :chartData="chartData"
            />
          </view>
        </uni-section>
      </el-card>
      <el-card shadow="never" class="card">
        <uni-section title="部门统计" titleFontSize="30rpx" type="line">
          <view class="charts-box">
            <qiun-data-charts
                type="column"
                :opts="opts1"
                :chartData="chartData1"
            />
          </view>
        </uni-section>
      </el-card>
      <el-card shadow="never" class="card">
        <uni-section title="地区反馈统计" titleFontSize="30rpx" type="line">
          <view class="charts-box">
            <qiun-data-charts
                type="bar"
                :opts="opts2"
                :chartData="chartData2"
            />
          </view>
        </uni-section>
      </el-card>
		</div>
		<uni-popup ref="inputDialog" type="dialog">
			<uni-popup-dialog ref="inputClose" mode="input" title="选择下达类型" value="对话框预置提示内容!" placeholder="请选择下达类型"
				@confirm="toIssuanceThroughList(xdlx)">
				<uni-forms-item>
					<uni-data-checkbox v-model="xdlx" :localdata="xdlxs" />
				</uni-forms-item>
			</uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import {
		getFkxxByUserId,
		queryUserByUsername,
		getLoginUserInfoByAppToken,
		loginByToken
	} from "@/api/system/yjgl";
	import {
		setApptoken,
		getApptoken,
		setUserId,
		setDeptId,
		setIsleader,
		setUsername,
		getUsername,
		setToken
	} from '@/utils/auth';
	import app from "@/App.vue";
  import {
    getAppRwPage,
    addApptoken,
    getMySendMatter, getSxlxCountData, getXdbmCount
  } from "@/api/system/xdwj";
	export default {
		name: "index",
		data() {
			return {
        chartData: {},
        chartData1: {},
        chartData2: {},
        opts: {
          rotate: false,
          rotateLock: false,
          color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
          padding: [5,5,5,5],
          dataLabel: true,
          enableScroll: false,
          legend: {
            show: true,
            position: "right",
            lineHeight: 25
          },
          extra: {
            ring: {
              ringWidth: 60,
              activeOpacity: 0.5,
              activeRadius: 10,
              offsetAngle: 0,
              labelWidth: 15,
              border: false,
              borderWidth: 3,
              borderColor: "#FFFFFF"
            }
          },

        },
        windowWidth:0,
        opts1: {
          color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
          padding: [15, 15, 0, 5],
          enableScroll: false,
          legend: {},
          xAxis: {
            disableGrid: true
          },
          yAxis: {
            data: [
              {
                min: 0
              }
            ]
          },
          extra: {
            column: {
              type: "group",
              width: 30,
              activeBgColor: "#000000",
              activeBgOpacity: 0.08
            }
          },
        },
        opts2: {
          color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
          padding: [15,30,0,5],
          enableScroll: false,
          legend: {},
          xAxis: {
            boundaryGap: "justify",
            disableGrid: false,
            min: 0,
            axisLine: false,
            max: 70
          },
          yAxis: {},
          extra: {
            bar: {
              type: "stack",
              width: 30,
              meterBorde: 1,
              meterFillColor: "#FFFFFF",
              activeBgColor: "#000000",
              activeBgOpacity: 0.08,
              categoryGap: 2
            }
          }
        },
				isMobile: false,
				xdlx: 1,
				xdlxs: [{
					value: 1,
					text: '一键直达'
				}, {
					value: 2,
					text: '逐级下达'
				}],
				fkxxList: [],
				rwbId: "",
				recentlyRw: {},
				pageParams: {
					username: getUsername(),
					total: 0,
					page: 1,
					limit: 1,
				},
				cggzCount: 0,
				yjygCount: 0,
				tfsjCount: 0,
				cggzCsCount: 0,
				yjygCsCount: 0,
				tfsjCsCount: 0,
				windowWidth: 0
			};
		},

		onLoad(option) {
			//  进入页面的时候执行一次
			uni.getSystemInfo().then(res=>{

						const windowWidth = res[1].windowWidth; // 窗口宽度
						// console.log(windowWidth)
						// const windowHeight = res.windowHeight; // 窗口高度
						this.windowWidth = windowWidth
						if(windowWidth>768){
									  // uni.hideTabBar()
									  document.getElementsByClassName('uni-page-head')[0].style.display='none'
						}else{
									 // uni.showTabBar()
									 document.getElementsByClassName('uni-page-head')[0].style.display='block'
						}
						// console.log(this.windowWidth)

			})
			if (option.isTz) {
				uni.navigateTo({
					url: `/pages/ckRwxx?rwbId=${option.rwbId}&isTz=${option.isTz}&ly=${option.ly}`
				});
			} else {
				let appToken = option.appToken;
				if (appToken) {
					setApptoken(appToken); // 存储appToken
					// 根据appToken获取用户信息
					loginByToken({
						appToken: getApptoken()
					}).then(res => {
						setToken(res.token);
						if (res.code) {
							setUserId(res.data.userId);
							setDeptId(res.data.departMentId);
							setIsleader(res.data.isleader);
							setUsername(res.data.username)
							this.getList(res.data.userId);
							this.addApptoken();
							this.getAppRecentlyRw();
						}
					})
				}
			}
			this.isMobile = window.innerWidth < 600;
			window.addEventListener('resize', () => {
				this.isMobile = window.innerWidth < 600;
			});
		},
		onShow() {
          this.getServerData();
          this.getServerData1();
          this.getServerData2();
		      this.getMySendMatter();
		      // this.getSxlxCountCs();
		      this.getAppRecentlyRw();
		//进入页面不触发获取数据  改变的时候触发
				const windowResizeCallback = (res) => {
				this.windowWidth=res.size.windowWidth
				  // console.log('变化后的窗口高度=' + res.size.windowHeight)
				}
				uni.onWindowResize(windowResizeCallback)


		    },
		methods: {
      getServerData() {
        getSxlxCountData({isCq:'1'}).then(res1=>{
          let res = {
            series: [
              {
                // data: [{"name":"常规工作","value":this.cggzCsCount},{"name":"预警预告","value":this.yjygCsCount},{"name":"突发事件","value":this.tfsjCsCount}]
                data: res1.data,
              }
            ]
          };
          this.chartData = JSON.parse(JSON.stringify(res));
        })
      },
      getServerData1() {
        //模拟从服务器获取数据时的延时
        //模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
        getXdbmCount().then(res1=>{
          let counts = res1.data.map(m=>m.count);
          let deptNames = res1.data.map(m => m.deptName);
          let res = {
            categories: deptNames,
            series: [
              {
                name: "下达数量",
                data: counts
              }
            ]
          };
          this.chartData1 = JSON.parse(JSON.stringify(res));
        })
      },
      getServerData2() {
        //模拟从服务器获取数据时的延时
        setTimeout(() => {
          //模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
          let res = {
            categories: ["长春市","吉林市","四平市","辽源市","通化市","白山市","松原市","白城市","延边市","长白山","梅河口"],
            series: [
              {
                name: "反馈数量",
                data: [35,36,31,33,13,34,11,12,13,14,15]
              },
            ]
          };
          this.chartData2 = JSON.parse(JSON.stringify(res));
        }, 500);
      },
			addApptoken() {
				addApptoken({
					appToken: getApptoken(),
					userName: getUsername()
				});
			},
			selectXdlx() {
				this.xdlx = 1;
				this.$refs.inputDialog.open();
			},
			exitApp() {
				var opt = {
					data: '', //回传给上一个页面的参数（字符串），没有则不传
					success: function(data) {},
					fail: function(data) {}
				}
				//插件调用代码
				WorkHelper.closeApp(opt);
			},
			getUrlParam(url) {
				const paramsRegex = /[?&]+([^=&]+)=([^&]*)/gi;
				const params = {};
				let match;
				while (match = paramsRegex.exec(url)) {
					params[match[1]] = match[2];
				}
				return params;
			},
			//访问微信地址，用来获取code
			getWeChatCode() {
				//通过微信官方接口获取code之后，会重新刷新设置的回调地址【redirect_uri】
				let redirect_uri = encodeURIComponent(window.location.href)
				window.location.href =
					"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7555960e312add1f&redirect_uri=" +
					redirect_uri + "&response_type=code&scope=snsapi_base&state=STATE&agentid=AGENTID#wechat_redirect"
			},
			// 企业微信登录
			async wxLogin(code) {
				this.$modal.loading("登录中，请耐心等待...")
				this.$store.dispatch('WxLogin', code).then(() => {
					this.$modal.closeLoading()
				})
			},
			onClick(e) {},
			getList(userId) {
				getFkxxByUserId({
					userId,'type':'wfk'
				}).then(res => {
					this.fkxxList = res.data
				})
			},
			toIssuanceThroughList(index,sxlx) {
				let username = getUsername();
				let _this = this;
				queryUserByUsername({
					username: username
				}).then(res => {
					if (res.code === 200) {
						let url = "";
						// 使用uni.navigateTo跳转到目标页面
						if (index == 1) {
							url = '/pages/home/through/issuanceAdd'
						}
						if (index == 2) {
							url = '/pages/home/step/issuanceList'
						}
						if (index == 3) {
							url = '/pages/index-bak'
						}
						if (index == 4) {
							url = '/pages/home/through/issuanceList'
						}
						if (index == 5) {
							if (!_this.recentlyRw.sid) {
								return;
							}
							url = '/pages/home/through/ckRwxx?sid=' + this.recentlyRw.sid
						}
						if (index == 6) {
							url = '/pages/home/through/issuanceList?isCq=1'
						}
            if (index == 7) {
              url = '/pages/home/through/issuanceList?myMatter=1&sxlx='+sxlx
            }
						uni.navigateTo({
							url: url // 假设你要跳转的页面路径为/pages/target/target
						});
					}
				})
			},
			getAppRecentlyRw() {
				getAppRwPage(this.pageParams).then(res => {
					if (res.rows.length > 0) {
						this.recentlyRw = res.rows[0];
					} else {
						this.recentlyRw = {xdsl:0,wdsl:0,yfk:0,wfk:0};
					}
				})
			},
      getMySendMatter() {
        getMySendMatter({}).then(res => {
					if (res.data) {
						let data = res.data;
						for (let i = 0; i < data.length; i++) {
							if (data[i].sxlx == 1) {
								this.cggzCount = data[i].count;
							}
							if (data[i].sxlx == 2) {
								this.yjygCount = data[i].count;
							}
							if (data[i].sxlx == 3) {
								this.tfsjCount = data[i].count;
							}
						}
					}
				})
			},
			// getSxlxCountCs() {
			// 	getSxlxCount({
			// 		isCq: '1'
			// 	}).then(res => {
			// 		if (res.data) {
			// 			let data = res.data;
			// 			for (let i = 0; i < data.length; i++) {
			// 				if (data[i].sxlx == 1) {
			// 					this.cggzCsCount = data[i].count;
			// 				}
			// 				if (data[i].sxlx == 2) {
			// 					this.yjygCsCount = data[i].count;
			// 				}
			// 				if (data[i].sxlx == 3) {
			// 					this.tfsjCsCount = data[i].count;
			// 				}
			// 			}
			// 		}
			// 	})
			// },
		}
	}
</script>

<style>
	page {
		background-color: #F6F6F6;
	}

.button-3d-1{
  position: relative;
  background: rgb(48, 90, 245);
  border: none;
  color: white;
  padding: 15px 24px;
  font-size: 27rpx;
  outline: none;
  box-shadow: 4px 4px 0 hsl(0, 4%, 73%);
}

		.index-container {
			margin: 30rpx;
			z-index: 9;
			margin-top: -100rpx;
			position: sticky;
		}

		.index-content {
			background-color: white;
			padding: 20rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin-bottom: 30rpx;
		}

		.index-content1 {
			background-color: white;
			padding: 20rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin-bottom: 10rpx;
		}

		.index-nav {
			text-align: center;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}

		.index-nav-image {
			height: 110rpx;
			width: 110rpx;
			position: absolute;
			right: 0;
			bottom: -20rpx;
		}

		.index-article {
			text-align: center;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}

		.index-article-text {
			font-size: 55rpx;
			margin-bottom: 10rpx;
		}

		.index-article-text-mid {
			font-size: 50rpx;
			margin-top: 10rpx;
		}

		.index-section {
			height: 100rpx;
			margin: 10rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
		}

		.index-article-bottom {
			text-align: center;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}

		.app-container {
			/* background-color: #fff; */
			padding: 20px;
		}

		.card {
			margin-bottom: 20px;
		}

		.iconSize {
			width: 100rpx;
			height: 100rpx;
			margin-bottom: 10rpx
		}


</style>
